/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once



#include "../A_核心/Bullet核心.h"
#include "../A_核心/Bullet几何.h"

#include "../../../S_Physics.h"

#include "BulletCollision/CollisionDispatch/btCollisionObject.h"
#include "BulletCollision/CollisionShapes/btConvexPointCloudShape.h"
//#include "BulletCollision/CollisionShapes/btConvexPointCloudShape.h"






struct S_物理体;
struct S_物理几何体;
struct S_物理材质;











struct S_Bullet静态碰撞 : public S_物理体 {
	btRigidBody* m_Body;

	S_Bullet静态碰撞(S_物理几何体& geom, S_物理材质& 材质, uint32 key = 0);
	~S_Bullet静态碰撞();



	inline void* f_getBody() { return m_Body; }
	//inline void* f_get关联对象() { return m_Body->userData; }
	inline void		f_冻结(bool no) { ; }

	inline void f_绑定关联对象(void* data) { m_Body->setUserPointer(data); }

	//void f_setLocation(const vec3& loc);
	//void f_setRot(const vec3& loc);
	void f_setLocRot(const vec3& loc, const vec3& r);
	void f_setPos(const vec3& l);
	void f_setRot(const vec3& r);
	void f_setVel(const vec3& l);
	vec3 f_getLocation();

};








struct S_Bullet刚体 : public S_物理体 {
	btRigidBody*		m_bt刚体;
	//float32				m_重量;
	

	S_Bullet刚体(S_物理几何体& geom, S_物理材质* 材质, uint32 key = 0);
	~S_Bullet刚体();

	void* f_getBody() { return m_bt刚体; }
	//void* f_get关联对象() { return m_刚体->userData; }
	//inline void		f_冻结(bool no) { m_刚体->setActorFlag(physx::PxActorFlag::eDISABLE_SIMULATION, no); }
	//void f_构建(S_Px物理引擎核心* core, const S_三角Mesh mesh, const vec3& loc, const vec4& rot, const vec3& scale);
	void f_绑定关联对象(void* data) {
		m_bt刚体->setUserPointer(data);
	}

	//void f_setLocation(const vec3& loc);
	//void f_setRot(const vec3& loc);
	void f_setLocRot(const vec3& loc, const vec3& r);
	void f_setPos(const vec3& l);
	void f_setRot(const vec3& r);
	void f_setVel(const vec3& l);
	vec3 f_getLocation();
	vec3 f_getLoc();


	void f_施加力(const vec3& 力);

};












struct S_Bullet控制 : public S_物理体 {
	btRigidBody* m_Body;

	S_Bullet控制(S_物理几何体& geom, S_物理材质& 材质, uint32 key = 0);
	~S_Bullet控制();



	inline void* f_getBody() { return m_Body; }
	//inline void* f_get关联对象() { return m_Body->userData; }
	inline void		f_冻结(bool no) { ; }

	inline void f_绑定关联对象(void* data) { m_Body->setUserPointer(data); }

	//void f_setLocation(const vec3& loc);
	//void f_setRot(const vec3& loc);
	void f_setLocRot(const vec3& loc, const vec3& r);
	void f_setPos(const vec3& l);
	void f_setRot(const vec3& r);
	void f_setVel(const vec3& l);
	vec3 f_getLocation();
	vec3 f_getLoc();

};















